# $Id$
# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>

pkgname=openmp
pkgver=5.0.0
pkgrel=1
pkgdesc="LLVM OpenMP Runtime Library"
arch=('i686' 'x86_64')
url="http://openmp.llvm.org/"
license=('custom:University of Illinois/NCSA Open Source License')
depends=('glibc')
makedepends=('cmake')
source=(http://llvm.org/releases/$pkgver/$pkgname-$pkgver.src.tar.xz{,.sig})
sha256sums=('c0ef081b05e0725a04e8711d9ecea2e90d6c3fbb1622845336d3d095d0a3f7c5'
            'SKIP')
validpgpkeys=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D'
              '11E521D646982372EB577A1F8F0871F202119294')

prepare() {
	cd "$pkgname-$pkgver.src"
	mkdir build
}

build() {
	cd "$pkgname-$pkgver.src/build"

  cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    ..
	make
}

package() {
  cd "$pkgname-$pkgver.src"

  make -C build DESTDIR="$pkgdir" install

  # libgomp.so is also provided by gcc-libs; remove it to fix the conflict
  rm "$pkgdir/usr/lib/libgomp.so"

  install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

# vim:set ts=2 sw=2 et:
